<?php
/*
 * @开发工具: JetBrains PhpStorm.
 * @文件名：NameWidget.class.php
 * @类功能: 取得名称
 * @开发者: zc
 * @开发时间： 14-10-28
 * @版本：version 1.0
 */
namespace app\common\widget;

use app\common\cache\admin\IAdminCache;
use app\common\cache\agent\IAgentAdminCache;
use app\common\cache\agent\IAgentCache;
use app\common\cache\agent\IAgentLevelCache;
use app\common\cache\article\IArticleCategoryCache;
use app\common\cache\bank\IBankCache;
use app\common\cache\car\ICarBrandCache;
use app\common\cache\car\ICarConfigCache;
use app\common\cache\car\ICarModelCache;
use app\common\cache\common\IAdLocationCache;
use app\common\cache\common\IAreaCache;
use app\common\cache\company\ICompanyAdminCache;
use app\common\cache\company\ICompanyBondPackageCache;
use app\common\cache\company\ICompanyBondRechargeCache;
use app\common\cache\company\ICompanyCache;
use app\common\cache\company\ICompanyLevelCache;
use app\common\cache\company\ICompanyPackageCache;
use app\common\cache\credit\ICreditCache;
use app\common\cache\credit\ICreditTagCache;
use app\common\cache\loan\ILoanAgencyCache;
use app\common\cache\loan\ILoanCache;
use app\common\cache\loan\ILoanTagCache;
use app\common\cache\insurance\IInsuranceCache;
use app\common\cache\insurance\IInsuranceTagCache;
use app\common\cache\insurance\IInsuranceAgencyCache;
use app\common\cache\small\ISmallAgencyCache;
use app\common\cache\small\ISmallCache;
use app\common\cache\small\ISmallTagCache;
use app\common\cache\user\IUserCache;
use app\common\cache\user\IUserLevelCache;
use app\common\cache\user\IUserMaterialItemCache;
use app\common\enum\IsDelete;
use app\common\ext\IDb;
use think\Controller;

class Name extends Controller{

    //静态变量
    private static $admin = null;
    private static $user= null;
    private static $bank= null;
    private static $area= null;
    private static $credit= null;
    private static $credit_tag= null;
    private static $agent= null;
    private static $agent_admin= null;
    private static $cooperate= null;
    private static $cooperate_admin= null;
    private static $loan= null;
    private static $loan_tag= null;
    private static $loan_agency= null;
    private static $small= null;
    private static $small_tag= null;
    private static $small_agency= null;
    private static $article=null;
    private static $article_category=null;
    private static $car_brand=null;
    private static $car_model=null;
    private static $car_config=null;
    private static $material_item=null;
    private static $agent_package=null;
    private static $agent_level=null;
    private static $company_level=null;
    private static $company=null;
    private static $company_admin=null;
    private static $company_package=null;
    private static $company_bond_package=null;
    private static $company_bond_recharge=null;
    private static $user_level=null;
    private static $ad_location=null;
    private static $insurance= null;
    private static $insurance_tag= null;
    private static $insurance_agency=null;

    /**
     * @功能：取得管理员名称
     * @param $admin_id int 管理员ID
     * @开发者：cxl
     * @return string
     */
    public static function admin($admin_id) {
        //判断是否为空
        if(empty($admin_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$admin[$admin_id])){
            return self::$admin[$admin_id];
        }

        //实例化对象
        $admin_info = IAdminCache::getInfo($admin_id,array("admin_id","real_name","admin_user"));

        //判断数据是否存在
        if(!empty($admin_info)){
            if(!empty($admin_info['real_name'])) {
                self::$admin[$admin_id] = $admin_info['real_name'];
            }else if(!empty($admin_info['admin_user'])){
                self::$admin[$admin_id] = $admin_info['admin_user'];
            }else{
                self::$admin[$admin_id] = "--";
            }
        }else{
            self::$admin[$admin_id] = "--";
        }

        //返回值
        return self::$admin[$admin_id];
    }

    /**
     * @功能：取得用户名称
     * @param $user_id int 用户ID
     * @开发者：cxl
     * @return string
     */
    public static function user($user_id) {
        //判断是否为空
        if(empty($user_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$user[$user_id])){
            return self::$user[$user_id];
        }

        //实例化对象
        $user_info = IUserCache::getInfo($user_id,array("user_id","real","nick","phone"));

        //判断数据是否存在
        if(empty($user_info) || empty($user_info['user_id'])){
            self::$user[$user_id] = "--";
        }else{
            //判断真实名称是否存在
            if(!empty($user_info['real'])) {
                self::$user[$user_id] = $user_info['real'];
            }else{
                if(!empty($user_info['nick'])) {
                    self::$user[$user_id] = $user_info['nick'];
                }else{
                    self::$user[$user_id] = $user_info['phone'];
                }
            }
        }

        //返回值
        return self::$user[$user_id];
    }

    /**
     * @功能：取得银行名称
     * @param $bank_id int 银行ID
     * @开发者：cxl
     * @return string
     */
    public static function bank($bank_id) {
        //判断是否为空
        if(empty($bank_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$bank[$bank_id])){
            return self::$bank[$bank_id];
        }

        //实例化对象
        $bank_info = IBankCache::getInfo($bank_id,array("bank_id","bank_name"));

        //判断数据是否存在
        if(empty($bank_info) || empty($bank_info['bank_id'])){
            self::$bank[$bank_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($bank_info['bank_name'])) {
                self::$user[$bank_id] = "--";
            }else{
                self::$user[$bank_id] = $bank_info['bank_name'];
            }
        }

        //返回值
        return self::$user[$bank_id];
    }

    /**
     * @功能：取得区域名称
     * @param $area_id int 银行ID
     * @开发者：cxl
     * @return string
     */
    public static function area($area_id) {
        //判断是否为空
        if(empty($area_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$area[$area_id])){
            return self::$area[$area_id];
        }

        //实例化对象
        $area_info = IAreaCache::getInfo($area_id,array("area_id","acronym"));

        //判断数据是否存在
        if(empty($area_info) || empty($area_info['area_id'])){
            self::$area[$area_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($area_info['acronym'])) {
                self::$area[$area_id] = "--";
            }else{
                self::$area[$area_id] = $area_info['acronym'];
            }
        }

        //返回值
        return self::$area[$area_id];
    }

    /**
     * @功能：取得信用卡名称
     * @param $credit_product_id int 信用卡ID
     * @开发者：cxl
     * @return string
     */
    public static function credit($credit_product_id) {
        //判断是否为空
        if(empty($credit_product_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$credit[$credit_product_id])){
            return self::$credit[$credit_product_id];
        }

        //实例化对象
        $credit_product_info = ICreditCache::getInfo($credit_product_id,array("credit_product_id","credit_product_name"));

        //判断数据是否存在
        if(empty($credit_product_info) || empty($credit_product_info['credit_product_id'])){
            self::$credit[$credit_product_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($credit_product_info['credit_product_name'])) {
                self::$credit[$credit_product_id] = "--";
            }else{
                self::$credit[$credit_product_id] = $credit_product_info['credit_product_name'];
            }
        }

        //返回值
        return self::$credit[$credit_product_id];
    }

    /**
     * @功能：取得信用卡标签
     * @param $credit_tag_id int 信用卡标签ID
     * @开发者：cxl
     * @return string
     */
    public static function credit_tag($credit_tag_id) {
        //判断是否为空
        if(empty($credit_tag_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$credit_tag[$credit_tag_id])){
            return self::$credit_tag[$credit_tag_id];
        }

        //实例化对象
        $credit_tag_info = ICreditTagCache::getInfo($credit_tag_id,array("credit_tag_id","credit_tag_name"));

        //判断数据是否存在
        if(empty($credit_tag_info) || empty($credit_tag_info['credit_tag_id'])){
            self::$credit_tag[$credit_tag_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($credit_tag_info['credit_tag_name'])) {
                self::$credit_tag[$credit_tag_id] = "--";
            }else{
                self::$credit_tag[$credit_tag_id] = $credit_tag_info['credit_tag_name'];
            }
        }

        //返回值
        return self::$credit_tag[$credit_tag_id];
    }

    /**
     * @功能：取得贷款名称
     * @param $loan_product_id int 贷款ID
     * @开发者：cxl
     * @return string
     */
    public static function loan($loan_product_id) {
        //判断是否为空
        if(empty($loan_product_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$loan[$loan_product_id])){
            return self::$loan[$loan_product_id];
        }

        //实例化对象
        $loan_product_info = ILoanCache::getInfo($loan_product_id,array("loan_product_id","loan_product_name"));

        //判断数据是否存在
        if(empty($loan_product_info) || empty($loan_product_info['loan_product_id'])){
            self::$loan[$loan_product_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($loan_product_info['loan_product_name'])) {
                self::$loan[$loan_product_id] = "--";
            }else{
                self::$loan[$loan_product_id] = $loan_product_info['loan_product_name'];
            }
        }

        //返回值
        return self::$loan[$loan_product_id];
    }

    /**
     * @功能：取得贷款标签
     * @param $loan_tag_id int 贷款标签ID
     * @开发者：cxl
     * @return string
     */
    public static function loan_tag($loan_tag_id) {
        //判断是否为空
        if(empty($loan_tag_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$loan_tag[$loan_tag_id])){
            return self::$loan_tag[$loan_tag_id];
        }

        //实例化对象
        $loan_tag_info = ILoanTagCache::getInfo($loan_tag_id,array("loan_tag_id","loan_tag_name","is_delete"));
        if($loan_tag_info['is_delete'] == IsDelete::Yes){
            return '--';
        }
        //判断数据是否存在
        if(empty($loan_tag_info) || empty($loan_tag_info['loan_tag_id'])){
            self::$loan_tag[$loan_tag_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($loan_tag_info['loan_tag_name'])) {
                self::$loan_tag[$loan_tag_id] = "--";
            }else{
                self::$loan_tag[$loan_tag_id] = $loan_tag_info['loan_tag_name'];
            }
        }

        //返回值
        return self::$loan_tag[$loan_tag_id];
    }

    /**
     * @功能：取得贷款机构
     * @param $loan_agency_id int 贷款机构ID
     * @开发者：cxl
     * @return string
     */
    public static function loan_agency($loan_agency_id) {
        //判断是否为空
        if(empty($loan_agency_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$loan_agency[$loan_agency_id])){
            return self::$loan_agency[$loan_agency_id];
        }

        //实例化对象
        $loan_agency_info = ILoanAgencyCache::getInfo($loan_agency_id,array("loan_agency_id","loan_agency_name"));

        //判断数据是否存在
        if(empty($loan_agency_info) || empty($loan_agency_info['loan_agency_id'])){
            self::$loan_agency[$loan_agency_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($loan_agency_info['loan_agency_name'])) {
                self::$loan_agency[$loan_agency_id] = "--";
            }else{
                self::$loan_agency[$loan_agency_id] = $loan_agency_info['loan_agency_name'];
            }
        }

        //返回值
        return self::$loan_agency[$loan_agency_id];
    }
    /**
     * @功能：取得保险名称
     * @param $insurance_product_id int 保险ID
     * @开发者：cxl
     * @return string
     */
    public static function insurance($insurance_product_id) {
        //判断是否为空
        if(empty($insurance_product_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$insurance[$insurance_product_id])){
            return self::$insurance[$insurance_product_id];
        }

        //实例化对象
        $insurance_product_info = IInsuranceCache::getInfo($insurance_product_id,array("insurance_product_id","insurance_product_name"));

        //判断数据是否存在
        if(empty($insurance_product_info) || empty($insurance_product_info['insurance_product_id'])){
            self::$insurance[$insurance_product_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($insurance_product_info['insurance_product_name'])) {
                self::$insurance[$insurance_product_id] = "--";
            }else{
                self::$insurance[$insurance_product_id] = $insurance_product_info['insurance_product_name'];
            }
        }

        //返回值
        return self::$insurance[$insurance_product_id];
    }

    /**
     * @功能：取得保险标签
     * @param $insurance_tag_id int 保险标签ID
     * @开发者：cxl
     * @return string
     */
    public static function insurance_tag($insurance_tag_id) {
        //判断是否为空
        if(empty($insurance_tag_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$insurance_tag[$insurance_tag_id])){
            return self::$insurance_tag[$insurance_tag_id];
        }

        //实例化对象
        $insurance_tag_info = IInsuranceTagCache::getInfo($insurance_tag_id,array("insurance_tag_id","insurance_tag_name","is_delete"));
        if($insurance_tag_info['is_delete'] == IsDelete::Yes){
            return '--';
        }
        //判断数据是否存在
        if(empty($insurance_tag_info) || empty($insurance_tag_info['insurance_tag_id'])){
            self::$insurance_tag[$insurance_tag_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($insurance_tag_info['insurance_tag_name'])) {
                self::$insurance_tag[$insurance_tag_id] = "--";
            }else{
                self::$insurance_tag[$insurance_tag_id] = $insurance_tag_info['insurance_tag_name'];
            }
        }

        //返回值
        return self::$insurance_tag[$insurance_tag_id];
    }

    /**
     * @功能：取得保险机构
     * @param $insurance_agency_id int 保险机构ID
     * @开发者：cxl
     * @return string
     */
    public static function insurance_agency($insurance_agency_id) {
        //判断是否为空
        if(empty($insurance_agency_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$insurance_agency[$insurance_agency_id])){
            return self::$insurance_agency[$insurance_agency_id];
        }

        //实例化对象
        $insurance_agency_info = IInsuranceAgencyCache::getInfo($insurance_agency_id,array("insurance_agency_id","insurance_agency_name"));

        //判断数据是否存在
        if(empty($insurance_agency_info) || empty($insurance_agency_info['insurance_agency_id'])){
            self::$insurance_agency[$insurance_agency_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($insurance_agency_info['insurance_agency_name'])) {
                self::$insurance_agency[$insurance_agency_id] = "--";
            }else{
                self::$insurance_agency[$insurance_agency_id] = $insurance_agency_info['insurance_agency_id'];
            }
        }

        //返回值
        return self::$insurance_agency[$insurance_agency_id];
    }

    /**
     * @功能：取得小贷名称
     * @param $small_product_id int 小贷ID
     * @开发者：cxl
     * @return string
     */
    public static function small($small_product_id) {
        //判断是否为空
        if(empty($small_product_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$small[$small_product_id])){
            return self::$small[$small_product_id];
        }

        //实例化对象
        $small_product_info = ISmallCache::getInfo($small_product_id,array("small_product_id","small_product_name"));

        //判断数据是否存在
        if(empty($small_product_info) || empty($small_product_info['small_product_id'])){
            self::$small[$small_product_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($small_product_info['small_product_name'])) {
                self::$small[$small_product_id] = "--";
            }else{
                self::$small[$small_product_id] = $small_product_info['small_product_name'];
            }
        }

        //返回值
        return self::$small[$small_product_id];
    }

    /**
     * @功能：取得小贷标签
     * @param $small_tag_id int 小贷标签ID
     * @开发者：cxl
     * @return string
     */
    public static function small_tag($small_tag_id) {
        //判断是否为空
        if(empty($small_tag_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$small_tag[$small_tag_id])){
            return self::$small_tag[$small_tag_id];
        }

        //实例化对象
        $small_tag_info = ISmallTagCache::getInfo($small_tag_id,array("small_tag_id","small_tag_name","is_delete"));

        if($small_tag_info['is_delete'] == IsDelete::Yes){
            return '--';
        }

        //判断数据是否存在
        if(empty($small_tag_info) || empty($small_tag_info['small_tag_id'])){
            self::$small_tag[$small_tag_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($small_tag_info['small_tag_name'])) {
                self::$small_tag[$small_tag_id] = "--";
            }else{
                self::$small_tag[$small_tag_id] = $small_tag_info['small_tag_name'];
            }
        }

        //返回值
        return self::$small_tag[$small_tag_id];
    }

    /**
     * @功能：取得小贷机构
     * @param $small_agency_id int 小贷机构ID
     * @开发者：cxl
     * @return string
     */
    public static function small_agency($small_agency_id) {
        //判断是否为空
        if(empty($small_agency_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$small_agency[$small_agency_id])){
            return self::$small_agency[$small_agency_id];
        }

        //实例化对象
        $small_agency_info = ISmallAgencyCache::getInfo($small_agency_id,array("small_agency_id","small_agency_name"));

        //判断数据是否存在
        if(empty($small_agency_info) || empty($small_agency_info['small_agency_id'])){
            self::$small_agency[$small_agency_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($small_agency_info['small_agency_name'])) {
                self::$small_agency[$small_agency_id] = "--";
            }else{
                self::$small_agency[$small_agency_id] = $small_agency_info['small_agency_name'];
            }
        }

        //返回值
        return self::$small_agency[$small_agency_id];
    }

    /**
     * @功能：文章
     * @param $article_id int 文章
     * @开发者：cxl
     * @return string
     */
    public static function article($article_id) {
        //判断是否为空
        if(empty($article_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$article[$article_id])){
            return self::$article[$article_id];
        }

        //实例化对象
        $article_info = IDb::getInstance("article")->setDbFiled("article_id,title")->setDbWhere("article_id='{$article_id}'")->row();

        //判断数据是否存在
        if(empty($article_info) || empty($article_info['article_id'])){
            self::$article[$article_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($article_info['title'])) {
                self::$article[$article_id] = "--";
            }else{
                self::$article[$article_id] = $article_info['title'];
            }
        }

        //返回值
        return self::$article[$article_id];
    }

    /**
     * @功能：文章分类
     * @param $category_id int 文章分类
     * @开发者：cxl
     * @return string
     */
    public static function article_category($category_id) {
        //判断是否为空
        if(empty($category_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$article_category[$category_id])){
            return self::$article_category[$category_id];
        }

        //实例化对象
        $category_info = IArticleCategoryCache::getInfo($category_id,array("category_id","category_name"));

        //判断数据是否存在
        if(empty($category_info) || empty($category_info['category_id'])){
            self::$article_category[$category_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($category_info['category_name'])) {
                self::$article_category[$category_id] = "--";
            }else{
                self::$article_category[$category_id] = $category_info['category_name'];
            }
        }

        //返回值
        return self::$article_category[$category_id];
    }

    /**
     * @功能：取得代理商名称
     * @param $agent_id int 代理商ID
     * @开发者：cxl
     * @return string
     */
    public static function agent($agent_id) {
        //判断是否为空
        if(empty($agent_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$agent[$agent_id])){
            return self::$agent[$agent_id];
        }

        //实例化对象
        $info = IAgentCache::getInfo($agent_id,array("agent_id","agent_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['agent_id'])){
            self::$agent[$agent_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['agent_name'])) {
                self::$agent[$agent_id] = "--";
            }else{
                self::$agent[$agent_id] = $info['agent_name'];
            }
        }

        //返回值
        return self::$agent[$agent_id];
    }

    /**
     * @功能：取得代理商名称
     * @param $agent_admin_id int 代理商ID
     * @param $agent int|bool 显示信息
     * @开发者：cxl
     * @return string
     */
    public static function agent_admin($agent_admin_id,$agent=false) {
        //判断是否为空
        if(empty($agent_admin_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$agent_admin[$agent_admin_id])){
            return self::$agent_admin[$agent_admin_id];
        }

        //实例化对象
        $info = IAgentAdminCache::getInfo($agent_admin_id,array("agent_admin_id","agent_id","real","account","mobile"));

        //判断数据是否存在
        if(empty($info) || empty($info['agent_admin_id'])){
            self::$agent_admin[$agent_admin_id] = "--";
        }else{
            //判断真实名称是否存在
            if(!empty($info['real'])) {
                //设置用户信息
                self::$agent_admin[$agent_admin_id] = $info['real'];

                //返回值
                if($agent === false) {
                    return self::$agent_admin[$agent_admin_id];
                }else{
                    if($agent == "1"){
                        //取得公司信息
                        $agent = self::agent($info['agent_id']);
                        if($agent != "--") {
                            return self::$agent_admin[$agent_admin_id] . "(" . self::agent($info['agent_id']) . ")";
                        }
                    }else {
                        //判断电话号码是否存在
                        if (!empty($info['mobile'])) {
                            return self::$agent_admin[$agent_admin_id] . "（" . $info['mobile'] . "）";
                        }
                    }
                }
            }else{
                if(!empty($info['mobile'])) {
                    self::$agent_admin[$agent_admin_id] = $info['mobile'];

                    //判断是否需要公司信息
                    if($agent == "1"){
                        //取得公司信息
                        $agent = self::agent($info['agent_id']);
                        if($agent != "--") {
                            return self::$agent_admin[$agent_admin_id] . "(" . self::agent($info['agent_id']) . ")";
                        }
                    }
                }else{
                    self::$agent_admin[$agent_admin_id] = "--";
                }
            }
        }


    }

    /**
     * @功能：汽车品牌
     * @param $car_brand_id int 汽车品牌ID
     * @开发者：cxl
     * @return string
     */
    public static function car_brand($car_brand_id) {
        //判断是否为空
        if(empty($car_brand_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$car_brand[$car_brand_id])){
            return self::$car_brand[$car_brand_id];
        }

        //实例化对象
        $info = ICarBrandCache::getInfo($car_brand_id,array("car_brand_id","car_brand_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['car_brand_id'])){
            self::$car_brand[$car_brand_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['car_brand_name'])) {
                self::$car_brand[$car_brand_id] = "--";
            }else{
                self::$car_brand[$car_brand_id] = $info['car_brand_name'];
            }
        }

        //返回值
        return self::$car_brand[$car_brand_id];
    }

    /**
     * @功能：汽车型号
     * @param $car_model_id int 汽车品牌ID
     * @开发者：cxl
     * @return string
     */
    public static function car_model($car_model_id) {
        //判断是否为空
        if(empty($car_model_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$car_model[$car_model_id])){
            return self::$car_model[$car_model_id];
        }

        //实例化对象
        $info = ICarModelCache::getInfo($car_model_id,array("car_model_id","car_model_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['car_model_id'])){
            self::$car_model[$car_model_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['car_model_name'])) {
                self::$car_model[$car_model_id] = "--";
            }else{
                self::$car_model[$car_model_id] = $info['car_model_name'];
            }
        }

        //返回值
        return self::$car_model[$car_model_id];
    }

    /**
     * @功能：汽车配置
     * @param $car_config_id int 汽车配置ID
     * @开发者：cxl
     * @return string
     */
    public static function car_config($car_config_id) {
        //判断是否为空
        if(empty($car_config_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$car_config[$car_config_id])){
            return self::$car_config[$car_config_id];
        }

        //实例化对象
        $info = ICarConfigCache::getInfo($car_config_id,array("car_config_id","car_config_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['car_config_id'])){
            self::$car_config[$car_config_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['car_config_name'])) {
                self::$car_config[$car_config_id] = "--";
            }else{
                self::$car_config[$car_config_id] = $info['car_config_name'];
            }
        }

        //返回值
        return self::$car_config[$car_config_id];
    }

    /**
     * @功能：汽车型号
     * @param $material_item_id int 汽车品牌ID
     * @开发者：cxl
     * @return string
     */
    public static function material_item($material_item_id) {
        //判断是否为空
        if(empty($material_item_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$material_item[$material_item_id])){
            return self::$material_item[$material_item_id];
        }

        //实例化对象
        $info = IUserMaterialItemCache::getInfo($material_item_id,array("material_item_id","material_item_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['material_item_id'])){
            self::$material_item[$material_item_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['material_item_name'])) {
                self::$material_item[$material_item_id] = "--";
            }else{
                self::$material_item[$material_item_id] = $info['material_item_name'];
            }
        }

        //返回值
        return self::$material_item[$material_item_id];
    }

    /**
     * @功能：信贷经理套餐信息
     * @param $agent_package_id int 信贷经理套餐ID
     * @开发者：cxl
     * @return string
     */
    public static function agent_package($agent_package_id) {
        //判断是否为空
        if(empty($agent_package_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$agent_package[$agent_package_id])){
            return self::$agent_package[$agent_package_id];
        }

        //实例化对象
        $info = IAgentPackageCache::getInfo($agent_package_id,array("agent_package_id","agent_package_name","agent_package_price"));

        //判断数据是否存在
        if(empty($info) || empty($info['agent_package_id'])){
            self::$agent_package[$agent_package_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['agent_package_name'])) {
                self::$agent_package[$agent_package_id] = "--";
            }else{
                //判断价格是否存在
                if(empty($info['agent_package_price'])){
                    self::$agent_package[$agent_package_id] = $info['agent_package_name'];
                }else{
                    self::$agent_package[$agent_package_id] = $info['agent_package_name']."（￥".number_format($info['agent_package_price'],2)."元）";
                }
            }
        }

        //返回值
        return self::$agent_package[$agent_package_id];
    }

    /**
     * @功能：代理商等级
     * @param $agent_level_id int 代理商等级
     * @开发者：cxl
     * @return string
     */
    public static function agent_level($agent_level_id) {
        //判断是否为空
        if(empty($agent_level_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$agent_level[$agent_level_id])){
            return self::$agent_level[$agent_level_id];
        }

        //实例化对象
        $info = IAgentLevelCache::getInfo($agent_level_id,array("agent_level_id","agent_level_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['agent_level_id'])){
            self::$agent_level[$agent_level_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['agent_level_name'])) {
                self::$agent_level[$agent_level_id] = "--";
            }else{
                self::$agent_level[$agent_level_id] = $info['agent_level_name'];
            }
        }

        //返回值
        return self::$agent_level[$agent_level_id];
    }

    /**
     * @功能：信贷公司等级
     * @param $company_level_id int 信贷公司等级
     * @开发者：cxl
     * @return string
     */
    public static function company_level($company_level_id) {
        //判断是否为空
        if(empty($company_level_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$company_level[$company_level_id])){
            return self::$company_level[$company_level_id];
        }

        //实例化对象
        $info = ICompanyLevelCache::getInfo($company_level_id,array("company_level_id","company_level_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['company_level_id'])){
            self::$company_level[$company_level_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['company_level_name'])) {
                self::$company_level[$company_level_id] = "--";
            }else{
                self::$company_level[$company_level_id] = $info['company_level_name'];
            }
        }

        //返回值
        return self::$company_level[$company_level_id];
    }

    /**
     * @功能：信贷公司名称
     * @param $company_id int 信贷公司编号
     * @开发者：cxl
     * @return string
     */
    public static function company($company_id) {
        //判断是否为空
        if(empty($company_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$company[$company_id])){
            return self::$company[$company_id];
        }

        //实例化对象
        $info = ICompanyCache::getInfo($company_id,array("company_id","company_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['company_id'])){
            self::$company[$company_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['company_name'])) {
                self::$company[$company_id] = "--";
            }else{
                self::$company[$company_id] = $info['company_name'];
            }
        }

        //返回值
        return self::$company[$company_id];
    }

    /**
     * @功能：信贷公司业务员名称
     * @param $company_admin_id int 信贷公司业务员编号
     * @开发者：cxl
     * @return string
     */
    public static function company_admin($company_admin_id) {
        //判断是否为空
        if(empty($company_admin_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$company_admin[$company_admin_id])){
            return self::$company_admin[$company_admin_id];
        }

        //实例化对象
        $info = ICompanyAdminCache::getInfo($company_admin_id,array("company_admin_id","phone","nick","real"));

        //判断数据是否存在
        if(empty($info) || empty($info['company_admin_id'])){
            self::$company_admin[$company_admin_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['real'])) {
                //判断昵称是否存在
                if(empty($info['nick'])) {
                    //判断昵称是否存在
                    if(empty($info['phone'])) {
                        self::$company_admin[$company_admin_id] = "--";
                    }else{
                        self::$company_admin[$company_admin_id] = $info['phone'];
                    }
                }else{
                    self::$company_admin[$company_admin_id] = $info['nick'];
                }
            }else{
                self::$company_admin[$company_admin_id] = $info['real'];
            }
        }

        //返回值
        return self::$company_admin[$company_admin_id];
    }

    /**
     * @功能：信贷公司业务员名称
     * @param $company_package_id int 信贷公司业务员编号
     * @开发者：cxl
     * @return string
     */
    public static function company_package($company_package_id) {
        //判断是否为空
        if(empty($company_package_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$company_package[$company_package_id])){
            return self::$company_package[$company_package_id];
        }

        //实例化对象
        $info = ICompanyPackageCache::getInfo($company_package_id,array("company_package_id","company_package_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['company_package_id'])){
            self::$company_package[$company_package_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['company_package_name'])) {
                self::$company_package[$company_package_id] = "--";
            }else{
                self::$company_package[$company_package_id] = $info['company_package_name'];
            }
        }

        //返回值
        return self::$company_package[$company_package_id];
    }

    /**
     * @功能：信贷公司招标宝开通套餐名称
     * @param $company_bond_package_id int 信贷公司业务员编号
     * @开发者：cxl
     * @return string
     */
    public static function company_bond_package($company_bond_package_id) {
        //判断是否为空
        if(empty($company_bond_package_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$company_bond_package[$company_bond_package_id])){
            return self::$company_bond_package[$company_bond_package_id];
        }

        //实例化对象
        $info = ICompanyBondPackageCache::getInfo($company_bond_package_id,array("company_bond_package_id","company_bond_package_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['company_bond_package_id'])){
            self::$company_bond_package[$company_bond_package_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['company_bond_package_name'])) {
                self::$company_bond_package[$company_bond_package_id] = "--";
            }else{
                self::$company_bond_package[$company_bond_package_id] = $info['company_bond_package_name'];
            }
        }

        //返回值
        return self::$company_bond_package[$company_bond_package_id];
    }

    /**
     * @功能：信贷公司招标宝保证金充值套餐名称
     * @param $company_bond_recharge_id int 信贷公司业务员编号
     * @开发者：cxl
     * @return string
     */
    public static function company_bond_recharge($company_bond_recharge_id) {
        //判断是否为空
        if(empty($company_bond_recharge_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$company_bond_recharge[$company_bond_recharge_id])){
            return self::$company_bond_recharge[$company_bond_recharge_id];
        }

        //实例化对象
        $info = ICompanyBondRechargeCache::getInfo($company_bond_recharge_id,array("company_bond_recharge_id","company_bond_recharge_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['company_bond_recharge_id'])){
            self::$company_bond_recharge[$company_bond_recharge_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['company_bond_recharge_name'])) {
                self::$company_bond_recharge[$company_bond_recharge_id] = "--";
            }else{
                self::$company_bond_recharge[$company_bond_recharge_id] = $info['company_bond_recharge_name'];
            }
        }

        //返回值
        return self::$company_bond_recharge[$company_bond_recharge_id];
    }

    /**
     * @功能：客户等级
     * @param $level_id int 客户等级
     * @开发者：cxl
     * @return string
     */
    public static function user_level($level_id) {
        //判断是否为空
        if(empty($level_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$user_level[$level_id])){
            return self::$user_level[$level_id];
        }

        //实例化对象
        $info = IUserLevelCache::getInfo($level_id,array("level_id","level_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['level_id'])){
            self::$user_level[$level_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['level_name'])) {
                self::$user_level[$level_id] = "--";
            }else{
                self::$user_level[$level_id] = $info['level_name'];
            }
        }

        //返回值
        return self::$user_level[$level_id];
    }

    /**
     * @功能：广告位名称
     * @param $ad_location_id int 广告位
     * @开发者：cxl
     * @return string
     */
    public static function ad_location($ad_location_id) {
        //判断是否为空
        if(empty($ad_location_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$ad_location[$ad_location_id])){
            return self::$ad_location[$ad_location_id];
        }

        //实例化对象
        $info = IAdLocationCache::getInfo($ad_location_id,array("ad_location_id","ad_location_name"));

        //判断数据是否存在
        if(empty($info) || empty($info['ad_location_id'])){
            self::$ad_location[$ad_location_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['ad_location_name'])) {
                self::$ad_location[$ad_location_id] = "--";
            }else{
                self::$ad_location[$ad_location_id] = $info['ad_location_name'];
            }
        }

        //返回值
        return self::$ad_location[$ad_location_id];
    }
    /**
     * @功能：取得合作商名称
     * @param $cooperate_id int 合作商ID
     * @开发者：cxl
     * @return string
     */
    public static function cooperate($cooperate_id) {
        //判断是否为空
        if(empty($cooperate_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$cooperate[$cooperate_id])){
            return self::$cooperate[$cooperate_id];
        }

        //实例化对象
        $info = IDb::getInstance('cooperate')->setDbWhere(array('cooperate_id'=>$cooperate_id))->row();

        //判断数据是否存在
        if(empty($info) || empty($info['cooperate_id'])){
            self::$cooperate[$cooperate_id] = "--";
        }else{
            //判断真实名称是否存在
            if(empty($info['cooperate_name'])) {
                self::$cooperate[$cooperate_id] = "--";
            }else{
                self::$cooperate[$cooperate_id] = $info['cooperate_name'];
            }
        }

        //返回值
        return self::$cooperate[$cooperate_id];
    }

    /**
     * @功能：取得合作商名称
     * @param $cooperate_admin_id int 合作商ID
     * @开发者：cxl
     * @return string
     */
    public static function cooperate_admin($cooperate_admin_id,$cooperate=false) {
        //判断是否为空
        if(empty($cooperate_admin_id)){
            return "--";
        }

        //判断缓存是否存在
        if(!empty(self::$cooperate_admin[$cooperate_admin_id])){
            return self::$cooperate_admin[$cooperate_admin_id];
        }

        //实例化对象
        $info = IDb::getInstance('cooperate_admin')->setDbWhere(array('cooperate_admin_id'=>$cooperate_admin_id))->row();

        //判断数据是否存在
        if(empty($info) || empty($info['cooperate_admin_id'])){
            self::$cooperate_admin[$cooperate_admin_id] = "--";
        }else{
            //判断真实名称是否存在
            if(!empty($info['real'])) {
                //设置用户信息
                self::$cooperate_admin[$cooperate_admin_id] = $info['real'];

                //返回值
                if($cooperate === false) {
                    return self::$cooperate_admin[$cooperate_admin_id];
                }else{
                    if($cooperate == "1"){
                        //取得公司信息
                        $cooperate = self::cooperate($info['cooperate_id']);
                        if($cooperate != "--") {
                            return self::$cooperate_admin[$cooperate_admin_id] . "(" . self::cooperate($info['cooperate_id']) . ")";
                        }
                    }else {
                        //判断电话号码是否存在
                        if (!empty($info['mobile'])) {
                            return self::$cooperate_admin[$cooperate_admin_id] . "（" . $info['mobile'] . "）";
                        }
                    }
                }
            }else{
                if(!empty($info['mobile'])) {
                    self::$cooperate_admin[$cooperate_admin_id] = $info['mobile'];

                    //判断是否需要公司信息
                    if($cooperate == "1"){
                        //取得公司信息
                        $cooperate = self::cooperate($info['cooperate_id']);
                        if($cooperate != "--") {
                            return self::$cooperate_admin[$cooperate_admin_id] . "(" . self::cooperate($info['cooperate_id']) . ")";
                        }
                    }
                }else{
                    self::$cooperate_admin[$cooperate_admin_id] = "--";
                }
            }
        }


    }
}